package com.niu.service.impl;

import com.niu.mapper.OperateLogMapper;
import com.niu.pojo.OperateLog;
import com.niu.service.OperateLogService;
import com.niu.utils.MyThreadLocalUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.Map;

/**
 * @Author 鹅鹅鹅
 * @Version 1.0.0
 * @Date 2025/7/19 19:50
 * @Description
 */
@Service
public class OperateLogServiceImpl implements OperateLogService {

    @Autowired
    private OperateLogMapper logMapper;

    // 记录日志
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    @Override
    public void addLog(OperateLog log) {
        logMapper.insertLog(log);
    }
}
